import request from '@/untils/request.js'

// 发布文章 api

export const goArticles =data=>{
    return request({
        method:"Post",
        url:'/article/add',
        data
    })
}



// 查询所有文章（分页）api
export const getAllArticles =params=>{
    return request({
        method:"GET",
        url:'/article/findAll',
        params
    })
}
// 查询前端文章（分页）api
export const getAllWebArticles =params=>{
    return request({
        method:"GET",
        url:'/article/web/findAll',
        params
    })
}
// 根据浏览量查询前端文章（分页）api
export const getAllWebViewArticles =params=>{
    return request({
        method:"GET",
        url:'/article/web/findViewAll',
        params
    })
}

// 查询单个文章
export const getOneArticles =params=>{
    return request({
        method:"GET",
        url:'/article/findOne',
        params
    })
}

// 修改文章内容
export const updateArticle = data=>{
    return request({
        method:"Post",
        url:'/article/updata',
        data
    })
}

// 删除文章
export const delArticle = data=>{
    return request({
        method:"Post",
        url:'/article/del',
        data
    })
}